package com.iyundao.io.mapper;

import com.iyundao.io.model.ActivityImage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ActivityImageMapper {
    @Insert({
        "insert into activityimage (id, activityid, ",
        "activityimageurl, partymemberid)",
        "values (#{id,jdbcType=INTEGER}, #{activityid,jdbcType=INTEGER}, ",
        "#{activityimageurl,jdbcType=VARCHAR}, #{partymemberid,jdbcType=INTEGER})"
    })
    int insert(ActivityImage record);

    @InsertProvider(type=ActivityImageSqlProvider.class, method="insertSelective")
    int insertSelective(ActivityImage record);

    @Select("select activityimageurl from activityimage where activityid=#{activityid,jdbcType=INTEGER}")
    List<String> selectAllUrlByActivityId(Integer activityid);

}